/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package adelito;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author mdneto
 */
public class Exemplo2 {
     public Exemplo2(){
            // System.out.println("a classe foi instanciada");
            mensagem("");
     }    
     public void mensagem(String msg) {
           try {
                   FileInputStream le = new FileInputStream("c:\\exemplo1.txt");
                   InputStreamReader l = new InputStreamReader(le);
                   BufferedReader in = new BufferedReader(l);
                   String linha = in.readLine();
                   
                   while(linha!=null) {
                           System.out.println(linha);
                           linha=in.readLine();
                   }
                   in.close();
           } catch (IOException e) {
                   System.out.println("Erro"+e.getMessage());
           } catch (Exception e){
                   System.out.println("Erro");
           }
     }
}
